package com.sinosoft.vaccinetoai.server.business.chatrecord.getchatrecordlist.service.impl;

import com.sinosoft.vaccinetoai.dao.mapper.business.ChatRecordMapper;
import com.sinosoft.vaccinetoai.dao.po.business.ChatRecord;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import com.sinosoft.vaccinetoai.server.business.chatrecord.getchatrecordlist.io.GetChatRecordListIO;
import com.sinosoft.vaccinetoai.server.business.chatrecord.getchatrecordlist.vo.GetChatRecordListVO;
import com.sinosoft.vaccinetoai.server.business.chatrecord.getchatrecordlist.service.IGetChatRecordListService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName: GetChatRecordListServiceImpl
 * @ClassNameExplain: 
 * @Description: 用户聊天记录列表查询Service Impl
 * @author xiazhihao
 * @date 2023年12月18日 21:52
 */
@Slf4j
@Service("GetChatRecordListService")
public class GetChatRecordListServiceImpl implements IGetChatRecordListService {

	@Resource
	ChatRecordMapper chatRecordMapper;

	@Override
	public GetChatRecordListVO getChatRecordList(GetChatRecordListIO io) throws Exception {
        GetChatRecordListVO vo = new GetChatRecordListVO();
		List<ChatRecord> chatRecords = chatRecordMapper.listByIO(io);
		vo.setRows(chatRecords);
		vo.setTotal((long) chatRecords.size());
		return vo;
	}
	
}